home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 04 Pathfinding and Movement / 05 Hancock / Goal_FollowLink.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-08-20  |  658 b   |  35 lines

  1. #include "Goal.h"
  2.  
  3. class PathNode;
  4. class AI;
  5.  
  6. class Goal_FollowLink : public Goal, public GoalQueue
  7. {
  8. public:
  9.  
  10.     enum LinkType { Normal, Jump, JumpOverGap, Shimmy, MaxLinkTypes };
  11.     Goal_FollowLink( AI* pAI, const PathLink *pathlink);
  12.  
  13.     virtual ~Goal_FollowLink();
  14.  
  15.     virtual bool Success();
  16.  
  17.     // Update the goal
  18.     virtual void Update( float secs_elapsed );
  19.  
  20.     void DoLedgeShimmy();
  21.     void DoJumpOverGap();
  22.  
  23.     float ExpectedLinkSpeed() const;
  24.  
  25. protected:
  26.     bool active;
  27.     bool jumped;
  28.     float stuckTimer;
  29.     bool TooFarBelowLink(const CVector& curPos) const;
  30.     const PathLink *link;
  31.  
  32.     LinkType linkType;
  33. };
  34.  
  35. #endif // _Goal_FollowLink_H_